class Solution
{
public:
    int eliminateMaximum(vector<int> &dist, vector<int> &speed)
    {
        int n = dist.size();
        vector<int> reachTime(n);
        for (int i = 0; i < n; ++i)
        {
            reachTime[i] = ceil(dist[i] / static_cast<double>(speed[i]));
        }
        sort(reachTime.begin(), reachTime.end());
        for (int i = 1; i < n; ++i)
        {
            if (reachTime[i] < i + 1)
            {
                return i;
            }
        }
        return n;
    }
};